package com.liao.badminton.service.impl;

import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.liao.badminton.code.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liao.badminton.code.myenum.GroupAdminEnum;
import com.liao.badminton.code.util.NameUtil;
import com.liao.badminton.context.BaseContextHandler;
import com.liao.badminton.dto.BoutStatDto;
import com.liao.badminton.dto.UserGroupRefDto;
import com.liao.badminton.entity.BoutRecord;
import com.liao.badminton.entity.BoutStat;
import com.liao.badminton.entity.UserGroupRef;
import com.liao.badminton.redis.RedisEnum;
import com.liao.badminton.redis.RedisUtil;
import com.liao.badminton.code.util.EntityUtils;
import com.liao.badminton.code.util.CheckUtil;
import com.liao.badminton.entity.ImportRecord;
import com.liao.badminton.dto.ImportRecordDto;
import com.liao.badminton.service.*;
import com.liao.badminton.vo.BoutStatVo;
import com.liao.badminton.vo.ImportRecordVo;
import com.liao.badminton.mapper.ImportRecordMapper;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

import lombok.extern.log4j.Log4j2;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import static cn.hutool.core.util.ObjectUtil.isEmpty;
import static cn.hutool.core.util.ObjectUtil.isNotEmpty;

/**
 * @author liaocheng
 * @date 2024-10-31
 * description:录入记录表
 */
@Component
@Log4j2
public class ImportRecordServiceImpl extends ServiceImpl<ImportRecordMapper, ImportRecord> implements ImportRecordService {
    @Resource
    private BoutRecordService boutRecordService;
    @Resource
    private BoutStatService boutStatService;
    @Resource
    private UserGroupRefService userGroupRefService;
    @Resource
    private BadmintonGroupService badmintonGroupService;


    /**
     * 新增
     */
    @Override

    public ResponseRest saveImportRecord(ImportRecordDto param) throws ProjectException {
        ImportRecord importRecord = param.invertEntity();
        Integer validStatus = param.getValidStatus();
        if (isNotEmpty(validStatus) && validStatus == 1) {
            badmintonGroupService.updateCompetitionNum(param.getGroupId(), 1);
        } else {
            param.setValidStatus(0);
        }
        if (isEmpty(param.getCreateTime())) { //
            EntityUtils.setCreatAndUpdateInfo(importRecord);
        } else {
            importRecord.setCreator(BaseContextHandler.getCurrUserID());
            importRecord.setUpdateTime(new Date());
        }
        boolean save = this.save(importRecord);
        if (save) {
            param.setId(importRecord.getId());
        }
        return ResponseRest.suc("saveImportRecord", handleText(param));
    }

    public static void main(String[] args) {
        ImportRecordDto param = new ImportRecordDto();
        param.setGroupId(2L);
        param.setTxtContent("博鹏鹏1胜软AmyX-3v3");
        ImportRecordServiceImpl importRecordService = new ImportRecordServiceImpl();
//        importRecordService.handleText(param);
        String s = "12.博鹏鹏.1胜软AmyX(fdaf,-3fafevdfa)-3v3";
        if (Character.isDigit(s.charAt(0)))
            s = s.substring(1, s.length());
        if (Character.isDigit(s.charAt(0)))
            s = s.substring(1, s.length());
        if (".".equals(s.charAt(0) + ""))
            s = s.substring(1, s.length());
//        s = s.contains("(") ? StringUtils.substringsBetween(s, "(", ")") : StringUtils.substringBetween(s, "（", "）");
        System.out.println(StringUtils.substringsBetween(s, "(", ")"));
        s = StringUtils.replace(s, "(" + StringUtils.substringBetween(s, "(", ")") + ")", "");
        System.out.println(s);
        if (s.contains("-")) {
            int i = s.indexOf("-");
            if ("V".equals(s.charAt(i + 2) + "") || "v".equals(s.charAt(i + 2) + "")) {
                String vs = StringUtils.substring(s, i + 1, i + 4);
                System.out.println(vs);
                s = s.replace("-" + vs, "");
            }
        }
        System.out.println(s);

    }

    private List<BoutStatVo> handleText(ImportRecordDto param) {
        List<BoutStat> boutStatList = CollectionUtil.newArrayList();
        List<BoutStatVo> boutStatVoList = CollectionUtil.newArrayList();
        List<BoutRecord> boutRecordList = CollectionUtil.newArrayList();
        Long importId = param.getId();
        String text = param.getTxtContent();
        Integer boutType = param.getBoutType() == null ? 2 : param.getBoutType();
        Integer validStatus = param.getValidStatus();
        Long groupId = param.getGroupId();
        Date createTime = param.getCreateTime();
        Long currUserID = BaseContextHandler.getCurrUserID();
        Map<String, BigDecimal> mapCount = new HashMap<>();//记录每个人的得分
        Map<String, Integer> mapWin = new HashMap<>();//记录每个人的胜利次数
        Map<String, Integer> mapLose = new HashMap<>();//记录每个人的失败次数
        Map<String, Integer> sexMap = new HashMap<>();//记录女生性别
        Map<String, List<String>> mapContent = new HashMap<>(); // 个人参与的对局
        parseTxt(text, boutType, groupId, createTime, currUserID, importId, mapCount, mapWin, mapLose, mapContent, boutRecordList, sexMap);
        for (String name : mapCount.keySet()) {
            int winBout = mapWin.get(name) == null ? 0 : mapWin.get(name);
            int loseBout = mapLose.get(name) == null ? 0 : mapLose.get(name);
            BigDecimal countBout = mapCount.get(name);
            UserGroupRefDto ugf = new UserGroupRefDto();
            ugf.setGroupId(groupId);
            ugf.setUserName(name);
            ugf.setSex(sexMap.get(name));
            UserGroupRef count = userGroupRefService.findUserGroupRefByGidUName(ugf);
            UserGroupRefDto insert = new UserGroupRefDto();
            if (count == null) {
                count = new UserGroupRef();
                insert.setGroupId(groupId);
                insert.setCompetitionNum(1);
                insert.setUserName(name);
                insert.setSex(sexMap.get(name) == null ? 1 : sexMap.get(name));
                insert.setWinBout(winBout);
                insert.setLoseBout(loseBout);
                insert.setTotalBout(winBout + loseBout);
                insert.setTotalScore(winBout - loseBout);
                insert.setAwardCoin(countBout);
                insert.setAdminType(GroupAdminEnum.general.getCode());
                insert.setCreateTime(createTime);
                if (validStatus == 1) {
                    ResponseRest responseRest = userGroupRefService.saveUserGroupRef(insert);
                    count.setId((Long) responseRest.getData());
                }
            } else {
                insert.setId(count.getId());
                insert.setCompetitionNum(count.getCompetitionNum() + 1);
                insert.setWinBout(count.getWinBout() + winBout);
                insert.setLoseBout(count.getLoseBout() + loseBout);
                insert.setTotalBout(count.getTotalBout() + winBout + loseBout);
                insert.setTotalScore(count.getTotalScore() + winBout - loseBout);
                insert.setAwardCoin(count.getAwardCoin().add(countBout));
                if (validStatus == 1) {
                    userGroupRefService.updateUserGroupRef(insert);
                }
            }
            BoutStat boutStat = new BoutStat();
            boutStat.setUserGroupRefId(count.getId());
            boutStat.setLoseBout(loseBout);
            boutStat.setWinBout(winBout);
            boutStat.setImportRecordId(importId);
            boutStat.setAwardCoin(countBout);
            boutStat.setTotalBout(winBout + loseBout);
            boutStat.setTotalScore(winBout - loseBout);
            boutStat.setTxtContent(mapContent.get(name).toString());
            boutStat.setCreator(currUserID);
            boutStat.setUpdater(currUserID);
            boutStat.setCreateTime(createTime);
            boutStat.setUpdateTime(new Date());
            boutStatList.add(boutStat);
            BoutStatVo boutStatVo = BoutStatVo.invertToVo(boutStat);
            boutStatVo.setUserGroupName(name);
            boutStatVoList.add(boutStatVo);
        }
        if (validStatus == 1) {
            boutRecordService.saveBatch(boutRecordList);
            boutStatService.saveBatch(boutStatList);
        }
        List<Map.Entry<String, BigDecimal>> list = new ArrayList<>(mapCount.entrySet());
        Collections.sort(list, Map.Entry.comparingByValue((a, b) -> b.compareTo(a)));
        System.out.println("总战绩：");
        list.stream().forEach(entry ->
                {
                    String key = entry.getKey();
                    Integer winBout = mapWin.get(key) == null ? 0 : mapWin.get(key);
                    Integer loseBout = mapLose.get(key) == null ? 0 : mapLose.get(key);
                    BigDecimal winScore = entry.getValue();
                    Integer totalScore = winBout + loseBout;
                    List<String> strings = mapContent.get(key);
                    int length = key.length();
                    if (length < 8) {
                        int i = 5 - length;
                        for (int j = 0; j < i; j++) {
                            key = key + " ";
                        }
                    }
//                    System.out.println(key + "   结算：" + winScore + " ; 胜局：" + winBout + " ;负局：" + loseBout + " ;总局：" + totalScore);
//                }
//                    System.out.println(key + "   结算：" + winScore + " ; 胜局：" + winBout + " ;负局：" + loseBout + " ;总局：" + totalScore + " ;参与对局：" + strings.toString());
                }
        );
        Collections.sort(boutStatVoList, (a, b) -> b.getAwardCoin().compareTo(a.getAwardCoin()));
        return boutStatVoList;

    }

    private void parseTxt(String text, Integer boutType, Long groupId,
                          Date createTime, Long currUserID, Long importId,
                          Map<String, BigDecimal> mapCount,
                          Map<String, Integer> mapWin,
                          Map<String, Integer> mapLose,
                          Map<String, List<String>> mapContent,
                          List<BoutRecord> boutRecordList,
                          Map<String, Integer> sexMap) {
        String[] boutList;
        if (text.contains("\n") || text.contains(";")) {
            boutList = text.contains("\n") ? text.split("\n") : text.split(";");
        } else {
            boutList = new String[]{text};
        }
        for (int i = 0; i < boutList.length; i++) {
            log.info("第{}----局：{}", i + 1, boutList[i]);
            String s = StrUtil.trim(boutList[i]);
            if (StrUtil.isBlank(s)) {
                continue;
            }
            String recodeDB = i + 1 + "、" + s;
            s = NameUtil.wipeIndex(s);
            Integer specificWinBoutType = null;
            Integer specificLoseBoutType = null;
            if (s.contains("胜")) {//博鹏鹏1胜软龙X(外围)-3v3
                Boolean isFemaleWin = false;
                Boolean isMaleWin = false;
                Boolean isWin = false;
                if (s.contains("@")) {
                    if (s.indexOf("@") < s.indexOf("胜")) isWin = true;
                    s = s.replaceAll("@", "");
                }
                if (s.contains("￥")) {
                    if (s.indexOf("￥") < s.indexOf("胜")) isMaleWin = true;
                    s = s.replaceAll("￥", "");
                }
                if (s.contains("-")) {
                    int vIndex = s.indexOf("-");
                    if ("V".equals(s.charAt(vIndex + 2) + "") || "v".equals(s.charAt(vIndex + 2) + "")) {
                        String vs = StringUtils.substring(s, vIndex + 1, vIndex + 4);
                        String[] split = vs.contains("v") ? vs.split("v") : vs.split("V");
                        specificWinBoutType = Integer.parseInt(split[0]);
                        specificLoseBoutType = Integer.parseInt(split[1]);
                        s = s.replace("-" + vs, "");
                    }
                }
                if ((s.contains("(") && s.contains(")")) || (s.contains("（") && s.contains("）"))
                ||(s.contains("（") && s.contains(")"))||(s.contains("(") && s.contains("）"))) { // 处理带有(,，、)的情况,外围不算胜负，只算奖励
                    String s1 = s.contains("(") ? StringUtils.substringBetween(s, "(", ")") : StringUtils.substringBetween(s, "（", "）");
                    if (s1.contains(":")) {
                        s1 = StrUtil.subAfter(s1, ":", true);
                    }
                    if (s1.contains("：")) {
                        s1 = StrUtil.subAfter(s1, "：", true);
                    }
                    List<String> split;
                    if (s1.contains(",")) {
                        split = StrUtil.split(s1, ",");
                    } else if (s1.contains("，")) {
                        split = StrUtil.split(s1, "，");
                        ;
                    } else if (s1.contains("、")) {
                        split = StrUtil.split(s1, "、");
                    } else {
                        split = CollectionUtil.newArrayList(s1);
                    }

                    for (String string : split) {
                        string = string.replaceAll(" ", "");
                        if (string.contains("+") || string.contains("-")) {
                            String[] strings = string.contains("+") ? string.split("\\+") : string.split("\\-");
                            BigDecimal value = new BigDecimal(strings[1]);
                            if (string.contains("-")) {
                                value = value.negate();
                            }
                            mapCount.put(strings[0], mapCount.getOrDefault(strings[0], BigDecimal.ZERO).add(value));
                            if (mapContent.containsKey(strings[0])) {
                                if (!mapContent.get(strings[0]).contains(recodeDB)) {
                                    mapContent.get(strings[0]).add(recodeDB);
                                }
                            } else {
                                mapContent.put(strings[0], CollectionUtil.newArrayList(recodeDB));
                            }
                        }
                    }
                    s = s.contains("(") ? StringUtils.replace(s, "(" + StringUtils.substringBetween(s, "(", ")") + ")", "")
                            : StringUtils.replace(s, "（" + StringUtils.substringBetween(s, "（", "）") + "）", "");
                }
                String[] teams = s.split("胜");
                String winner = teams[0];
                String fail = teams[1];
                int num = 1; //默认奖励1分
                //"x"可能是名字
                if (fail.contains("*") || fail.contains("＊")) {
                    num = fail.indexOf("*") > -1 ? Integer.parseInt(fail.substring(fail.indexOf("*") + 1, fail.length())) : Integer.parseInt(fail.substring(fail.indexOf("＊") + 1, fail.length()));
                    fail = fail.substring(0, fail.indexOf("*") == -1 ? fail.indexOf("＊") : fail.indexOf("*"));
                }
                List<String> namesWinner = NameUtil.findNames(winner, specificWinBoutType == null ? boutType : specificWinBoutType, groupId);
                Map<String, Boolean> countMap = new HashMap<>();
                namesWinner.stream().forEach(name -> {
                    countMap.put(name, true);}
                );
                for (String name : namesWinner) {
                    if (recodeDB.contains(name + "@") && isWin) {
                        sexMap.put(name, 0);
                    }
                    if (recodeDB.contains(name + "￥") && isWin) {
                        sexMap.put(name, 1);
                    }
                    List<String> orDefault = mapContent.getOrDefault(name, new ArrayList<>());
                    if (!orDefault.contains(recodeDB)) {
                        orDefault.add(recodeDB);
                        mapContent.put(name, orDefault);
                    }

                    if (countMap.get(name)) {
                        countMap.put(name, false);
                        mapWin.put(name, mapWin.getOrDefault(name, 0) + 1);
                    }
                    mapCount.put(name, mapCount.getOrDefault(name, BigDecimal.ZERO).add(new BigDecimal(num)));
                }

                List<String> namesFail = NameUtil.findNames(fail, specificLoseBoutType == null ? boutType : specificLoseBoutType, groupId);
                namesFail.stream().forEach(name -> {
                    countMap.put(name, true);}
                );
                for (String name : namesFail) {
                    if (recodeDB.contains(name + "@") && !isWin) {
                        sexMap.put(name, 0);
                    }
                    if (recodeDB.contains(name + "￥") && !isWin) {
                        sexMap.put(name, 1);
                    }
                    BigDecimal add = mapCount.getOrDefault(name, BigDecimal.ZERO).add(new BigDecimal(num).negate());
                    List<String> orDefault = mapContent.getOrDefault(name, new ArrayList<>());
                    if (!orDefault.contains(recodeDB)) {
                        orDefault.add(recodeDB);
                        mapContent.put(name, orDefault);
                    }
                    if (countMap.get(name)) {
                        countMap.put(name, false);
                        mapLose.put(name, mapLose.getOrDefault(name, 0) + 1);
                    }
                    mapCount.put(name, add);
                }
                BoutRecord boutRecord = new BoutRecord();
                boutRecord.setImportRecordId(importId);
                boutRecord.setGroupId(groupId);
                boutRecord.setBoutType(boutType);
                boutRecord.setTxtBout(recodeDB);
                boutRecord.setWinName(winner);
                boutRecord.setLoseName(fail);
                boutRecord.setAwardCoin(new BigDecimal(num));
                boutRecord.setCreator(currUserID);
                boutRecord.setUpdater(currUserID);
                boutRecord.setCreateTime(createTime);
                boutRecord.setUpdateTime(new Date());
                boutRecordList.add(boutRecord);
            }
        }
    }

    /**
     * 删除
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED, timeout = 10, rollbackFor = Exception.class)
    public ResponseRest<Boolean> deletesImportRecord(ImportRecordDto param) throws ProjectException {
        for (Long delId : param.getDelIds()) {
            ImportRecord importRecord = baseMapper.selectById(delId);
            if (isNotEmpty(importRecord)) {
                if (importRecord.getValidStatus() == 1) { //生效的统计要删除
                    badmintonGroupService.updateCompetitionNum(importRecord.getGroupId(), -1);
                    BoutStatDto boutStatDto = new BoutStatDto();
                    boutStatDto.setImportRecordId(delId);
                    List<BoutStat> boutStatList = boutStatService.findByDto(boutStatDto);
                    if (isNotEmpty(boutStatList)) {
                        List<Long> collect = boutStatList.stream().map(BoutStat::getUserGroupRefId).collect(Collectors.toList());
                        List<UserGroupRef> byIds = userGroupRefService.findByIds(collect);
                        Map<Long, UserGroupRef> collect1 = byIds.stream().collect(Collectors.toMap(UserGroupRef::getId, item -> item));
                        for (BoutStat boutStat : boutStatList) {
                            UserGroupRef userGroupRef = collect1.get(boutStat.getUserGroupRefId());
                            if (isEmpty(userGroupRef)) {
                                continue;
                            }
                            UserGroupRefDto userGroupRefDto = getUserGroupRefDto(boutStat, userGroupRef);
                            userGroupRefService.updateUserGroupRef(userGroupRefDto);
                        }
                    }
                }
//                boutStatService.deleteByImportRecordId(delId); //软删除
//                boutRecordService.deleteByImportRecordId(delId);//软删除
                boutRecordService.deleteByImportRecordIdHard(delId);//硬删除
                boutStatService.deleteByImportRecordIdHard(delId); //硬删除

            }
        }
//        boolean bool = this.removeByIds(param.getDelIds());//软删除
        boolean bool = this.removeByIds(param.getDelIds());//记录软删除-以后可以恢复
        if (bool) {
            param.getDelIds().forEach(id -> RedisUtil.toDelete(RedisEnum.CACHE_TABLE_DATA, "importRecord", "id", id));
        }
        return ResponseRest.suc("deletesImportRecord", true);
    }

    @Override
    public ResponseRest parseTxt(String text, Long groupId) {

        Map<String, BigDecimal> mapCount = new HashMap<>();//记录每个人的得分
        Map<String, Integer> mapWin = new HashMap<>();//记录每个人的胜利次数
        Map<String, Integer> mapLose = new HashMap<>();//记录每个人的失败次数
        Map<String, List<String>> mapContent = new HashMap<>(); // 个人参与的对局
        Map<String, Integer> sexMap = new HashMap<>();//记录女生性别
        parseTxt(text, 2, groupId, null, null, null, mapCount, mapWin, mapLose, mapContent, new ArrayList<>(), sexMap);
        List<BoutStatVo> boutStatVoList = CollectionUtil.newArrayList();
        for (String name : mapCount.keySet()) {
            int winBout = mapWin.get(name) == null ? 0 : mapWin.get(name);
            int loseBout = mapLose.get(name) == null ? 0 : mapLose.get(name);
            BigDecimal countBout = mapCount.get(name);
            BoutStat boutStat = new BoutStat();
            boutStat.setLoseBout(loseBout);
            boutStat.setWinBout(winBout);
            boutStat.setAwardCoin(countBout);
            boutStat.setTotalBout(winBout + loseBout);
            boutStat.setTotalScore(winBout - loseBout);
            boutStat.setUpdateTime(new Date());
            BoutStatVo boutStatVo = BoutStatVo.invertToVo(boutStat);
            boutStatVo.setUserGroupName(name);
            boutStatVoList.add(boutStatVo);
        }
        Collections.sort(boutStatVoList, (a, b) -> b.getAwardCoin().compareTo(a.getAwardCoin()));
        return ResponseRest.suc("parseTxt", boutStatVoList);
    }

    @NotNull
    private static UserGroupRefDto getUserGroupRefDto(BoutStat boutStat, UserGroupRef userGroupRef) {
        UserGroupRefDto userGroupRefDto = new UserGroupRefDto();
        userGroupRefDto.setId(userGroupRef.getId());
        userGroupRefDto.setCompetitionNum(userGroupRef.getCompetitionNum() - 1);
        userGroupRefDto.setWinBout(userGroupRef.getWinBout() - boutStat.getWinBout());
        userGroupRefDto.setLoseBout(userGroupRef.getLoseBout() - boutStat.getLoseBout());
        userGroupRefDto.setTotalBout(userGroupRef.getTotalBout() - boutStat.getTotalBout());
        userGroupRefDto.setTotalScore(userGroupRef.getTotalScore() - boutStat.getTotalScore());
        userGroupRefDto.setAwardCoin(userGroupRef.getAwardCoin().subtract(boutStat.getAwardCoin()));
        return userGroupRefDto;
    }

    /**
     * 修改
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED, timeout = 6000, rollbackFor = Exception.class)
    public ResponseRest<Boolean> updateImportRecord(ImportRecordDto param) throws ProjectException {
        Integer validStatus = param.getValidStatus();
        String txtContent = param.getTxtContent();
        ImportRecord importRecord = param.invertEntity();
        EntityUtils.setUpdatedInfo(importRecord);
        ImportRecord byId = this.getById(importRecord.getId());
        if (isEmpty(byId)) {
            ProjectException.newException(RespCodeMessage.DB_DATA_NULL, "导入记录不存在");
        }
        param.setGroupId(byId.getGroupId());
        if (validStatus == 1) { //成为有效生成统计
            if (isEmpty(txtContent)) {
                param.setTxtContent(byId.getTxtContent());
            }
            badmintonGroupService.updateCompetitionNum(param.getGroupId(), 1);
            handleText(param);
        }
        if (isNotEmpty(param.getCreateTime())) {
            importRecord.setCreateTime(param.getCreateTime());
        }
        boolean bool = this.updateById(importRecord);
        if (bool) {
            RedisUtil.toDelete(RedisEnum.CACHE_TABLE_DATA, "importRecord", "id", param.getId());
        }
        return ResponseRest.suc("updateImportRecord");
    }

    /**
     * 查询列表
     */
    @Override
    public ResponseRest findImportRecordByPageParam(PageParam<ImportRecordDto> pageParam) throws ProjectException {
        CheckUtil.checkValue(pageParam, "pageParam");
        ResponseRest resp = ResponseRest.suc("findImportRecordByPageParam");
        PageHelper.startPage(pageParam.getCurrent(), pageParam.getSize(), "create_time desc");
        List<ImportRecordVo> list = baseMapper.findByPageParam(pageParam);
        resp.setData(new PageInfo<>(list));
        return resp;
    }

    /**
     * 查询详情
     */
    @Override
    public ResponseRest findDetail(ImportRecordDto param) throws ProjectException {
        Object getDate = RedisUtil.toGetDate(RedisEnum.CACHE_TABLE_DATA, "importRecord", "id", param.getId());
        if (isNotEmpty(getDate)) {
            RedisUtil.toFlushExpire(RedisEnum.CACHE_TABLE_DATA, "importRecord", "id", param.getId());
            return ResponseRest.suc("findDetail", (ImportRecordVo) getDate);
        }
        ImportRecordVo vo = null;
        ImportRecord db = this.getById(param.getId());
        if (isNotEmpty(db)) {
            vo = ImportRecordVo.invertToVo(db);
            RedisUtil.toSaveRedis(RedisEnum.CACHE_TABLE_DATA, "importRecord", "id", param.getId(), vo, null);
        }
        return ResponseRest.suc("findDetail", vo);
    }

}
